package com.sqs.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sqs.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper extends BaseMapper<User> {

    /**
     * 根据用户名查询用户
     * @param username
     * @return
     * */
    @Select("select * from user where username = #{username}")
    User getByUsername(String username);

    /**
     * 根据id查询用户
     * @param id
     * @return
     * */
    @Select("select * from user where id = #{id}")
    User getById(Long id);

}
